#include<stdio.h>
#include<string.h>
char str[256];
void count(char *str, int *upper, int *lower, int *space, int *num, int *other);
int main(void){
	gets(str);
	int upper=0,lower=0,space=0,num=0,other=0;
	count(str,&upper,&lower,&space,&num,&other);
	printf("%d %d %d %d %d",upper,lower,space,num,other);
	return 0;}
void count(char *str, int *upper, int *lower, int *space, int *num, int *other){
	int i; 
	for(int i=0;i<strlen(str);i++){
		if(str[i]>='A'&&str[i]<='Z'){
			(*upper)++;}
		else{
		if(str[i]>='a'&&str[i]<='z'){
			(*lower)++;}
		else{
		if(str[i]==' '){
			(*space)++;}
		else{
		if(str[i]>='0'&&str[i]<='9'){
			(*num)++;}
		else{
			(*other)++;}}}}}}
